package com.shujia.flink.source

import org.apache.flink.streaming.api.scala.{DataStream, StreamExecutionEnvironment}

object Demo3SocketSource {
  def main(args: Array[String]): Unit = {

    val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment


    /**
      * 读取socket构建DS  --  无界流
      *
      */

    val socketDS: DataStream[String] = env.socketTextStream("master", 8888)

    socketDS.print()


    env.execute()


  }

}
